package com.cnzhy.esclientrhl.index;

import lombok.Data;
import org.zxp.esclientrhl.annotation.ESID;
import org.zxp.esclientrhl.annotation.ESMapping;
import org.zxp.esclientrhl.annotation.ESMetaData;
import org.zxp.esclientrhl.enums.DataType;

import java.util.Date;

/**
 * @Author: zhaoyan5
 */
@Data
@ESMetaData(indexName = "product_index", number_of_shards = 3, number_of_replicas = 0, printLog = true)
public class ProductInfoIndex {

    @ESID
    private String productId;

    @ESMapping(datatype = DataType.keyword_type)
    private String riskCode;

    @ESMapping(datatype = DataType.text_type)
    private String productName;

    @ESMapping
    private String businessNature;

    @ESMapping(datatype = DataType.text_type)
    private String businessNatureName;

    private String appliCode;//可以用默认值，这样会有appli_code.keyword可以直接搜

    @ESMapping(suggest = true)
    private String appliName;

    private String insuredCode;

    @ESMapping(ngram = true)
    private String insuredName;

    @ESMapping(datatype = DataType.date_type)
    private Date operateDate;

    @ESMapping(datatype = DataType.keyword_type)
    private String operateDateFormat;

    @ESMapping(datatype = DataType.date_type)
    private Date startDate;

    @ESMapping(datatype = DataType.date_type)
    private Date endDate;

    @ESMapping(datatype = DataType.double_type)
    private double sumAmount;

    @ESMapping(datatype = DataType.double_type)
    private double sumPremium;

    @ESMapping(datatype = DataType.keyword_type)
    private String comCode;
}
